package com.jason.basicandroid.service;

import android.os.Parcel;
import android.os.Parcelable;

public class Person implements Parcelable {
	private int age = 0;
	private String name = "";
	
	public static final Parcelable.Creator<Person> CREATOR =
		new Parcelable.Creator<Person>() {

			@Override
			public Person createFromParcel(Parcel source) {
				return new Person(source);
			}

			@Override
			public Person[] newArray(int size) {
				return new Person[size];
			}
		
	};
	
	public Person() {
		
	}
	
	private Person(Parcel source) {
		readFromParcel(source);
	}

	@Override
	public int describeContents() {
		return 0;
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		dest.writeInt(age);
		dest.writeString(name);
	}

	public void readFromParcel(Parcel source) {
		age = source.readInt();
		name = source.readString();		
	}
	
	public int getAge() {
		return age;
	}
	
	public void setAge(int age) {
		this.age = age;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
}
